package com.pug.ksd.springdockerdemo.web;

import com.pug.ksd.springdockerdemo.bean.KssUser;
import com.pug.ksd.springdockerdemo.mapper.KssUserMapper;
import com.pug.ksd.springdockerdemo.properties.KsdProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 飞哥
 * @Title: 学相伴出品
 * @Description: 飞哥B站地址：https://space.bilibili.com/490711252
 * 记得关注和三连哦！
 * @Description: 我们有一个学习网站：https://www.kuangstudy.com
 * @date 2022/1/8 17:06
 */
@RestController
@Slf4j
public class IndexController {

    @Autowired
    private KsdProperties ksdProperties;
    @Autowired
    private KssUserMapper kssUserMapper;

    @GetMapping("/getuser/{id}")
    public KssUser getuser(@PathVariable("id") Long id) {
        return kssUserMapper.selectById(id);
    }


    @GetMapping("/listuser")
    public List<KssUser> listuser() {
        return kssUserMapper.selectList(null);
    }

    @GetMapping("/listuser2")
    public List<KssUser> listuser2() {
        return kssUserMapper.selectList(null);
    }


    @GetMapping("/index")
    public String index() {
        return "Jenkins太好了，棒棒搭11111111111!!! ";
    }


    @GetMapping("/getevn")
    public KsdProperties getksdProperties() {
        return ksdProperties;
    }
}
